// Copyright (C) 2011 - Tencent Inc.
// Author: Liu Shaohui (struggleliu@tencent.com)
//
// Created: 08/16/2011 09:29:54
// Description:

#include <algorithm>
#include <stdio.h>
#include <string.h>
#include <vector>

#include "thirdparty/gflags/gflags.h"
#include "thirdparty/glog/logging.h"
#include "thirdparty/google/profiler.h"

typedef unsigned int      uint32_t;

DEFINE_string(prof_output_path, "./prof.prof", "The profile output path.");
DEFINE_string(data_file, "./data.in", "The input data file");

#define BUFSIZE 1<<12
char buf[BUFSIZE];

int main(int argc, char** argv) {
    ProfilerStart(FLAGS_prof_output_path.c_str());
    uint32_t altitude = 0, sum = 0;
    freopen(FLAGS_data_file.c_str(), "r", stdin);
    while (-1 != scanf("%d", &altitude)) {
                sum += altitude;
    }
    printf("%d\n", sum);
    ProfilerStop();
    return 0;
}
